package com.example.gatewaywebsocket.test;


import org.springframework.stereotype.Component;

import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;

@ServerEndpoint("/webSocket/test")
@Component
public class WebSocketStart {

    /**
     * 连接
     */
    @OnOpen
    public void connected(Session session) {
        session.getAsyncRemote().sendText("小伙子登陆成功!!!");

        // cacheSession(session);
    }
}
